<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>{ldelim},{rdelim}</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Smarty 3 Manual">
<link rel="up" href="language.builtin.functions.html" title="Chapter 7. Built-in Functions">
<link rel="prev" href="language.function.insert.html" title="{insert}">
<link rel="next" href="language.function.literal.html" title="{literal}">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">{ldelim},{rdelim}</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="language.function.insert.html">Prev</a> </td>
<th width="60%" align="center">Chapter 7. Built-in Functions</th>
<td width="20%" align="right"> <a accesskey="n" href="language.function.literal.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="sect1" title="{ldelim},{rdelim}">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="language.function.ldelim"></a>{ldelim},{rdelim}</h2></div></div></div>
<p>
   <code class="varname">{ldelim}</code> and <code class="varname">{rdelim}</code> are used for
   <a class="link" href="language.escaping.html" title="Escaping Smarty Parsing">escaping</a>
   template delimiters, by default
   <span class="bold"><strong>{</strong></span> and <span class="bold"><strong>}</strong></span>.
   You can also use <a class="link" href="language.function.literal.html" title="{literal}"><code class="varname">{literal}{/literal}</code></a>
   to escape blocks of text eg Javascript or CSS.
    See also the complimentary <a class="link" href="language.variables.smarty.html#language.variables.smarty.ldelim" title="{$smarty.ldelim}, {$smarty.rdelim}"><em class="parameter"><code>{$smarty.ldelim}</code></em></a>.
  </p>
<div class="example">
<a name="id377715"></a><p class="title"><b>Example 7.57. {ldelim}, {rdelim}</b></p>
<div class="example-contents">
<pre class="programlisting">

{* this will print literal delimiters out of the template *}

{ldelim}funcname{rdelim} is how functions look in Smarty!

   </pre>
<p>
    The above example will output:
   </p>
<pre class="screen">

{funcname} is how functions look in Smarty!

   </pre>
<p>Another example with some Javascript</p>
<pre class="programlisting">

&lt;script language="JavaScript"&gt;
function foo() {ldelim}
    ... code ...
{rdelim}
&lt;/script&gt;

   </pre>
<p>
   will output
   </p>
<pre class="screen">

&lt;script language="JavaScript"&gt;
function foo() {
    .... code ...
}
&lt;/script&gt;

   </pre>
</div>
</div>
<br class="example-break"><div class="example">
<a name="id377761"></a><p class="title"><b>Example 7.58. Another Javascript example</b></p>
<div class="example-contents"><pre class="programlisting">

&lt;script language="JavaScript" type="text/javascript"&gt;
    function myJsFunction(){ldelim}
        alert("The server name\n{$smarty.server.SERVER_NAME}\n{$smarty.server.SERVER_ADDR}");
    {rdelim}
&lt;/script&gt;
&lt;a href="javascript:myJsFunction()"&gt;Click here for Server Info&lt;/a&gt;

</pre></div>
</div>
<br class="example-break"><p>See also
  <a class="link" href="language.function.literal.html" title="{literal}"><code class="varname">{literal}</code></a>
  and <a class="link" href="language.escaping.html" title="Escaping Smarty Parsing">escaping Smarty parsing</a>.
  </p>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="language.function.insert.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="language.builtin.functions.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="language.function.literal.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">{insert} </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> {literal}</td>
</tr>
</table>
</div>
</body>
</html>
